#ifndef UTHSCRIPT_H_
#define UTHSCRIPT_H_

#include <string>

using namespace std;

namespace phnq
{
	namespace uth
	{
		class UTHValue;
		class UTHObject;
	
		/*
			TODO:
			Here I am thinking I can have two places for inserting data into a script:
		
			1) compile in static data
			2) pass in dynamic data as runtime parameters
		
			Examples of data that might be compiled in are aggregate script and style
			text.
		
			Runtime data could be:
			- http related data (i.e. request params, cookies, headers)
			- application data
		*/
	
		class UTHScript
		{
			public:
				static UTHScript* New(const char *code);
				virtual ~UTHScript();
				UTHObject* getGlobals();
				void setGlobals(UTHObject *globals);
				int getExecCount();
				UTHValue* execute();
				virtual void compile() = 0;
				virtual UTHValue* doExecute() = 0;
			
			protected:
				UTHScript();
				UTHObject *globals;
				
			private:
				int execCount;
		};
	}
}

#endif  //UTHSCRIPT_H_
